package blog.action;

import java.util.Date;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import blog.entity.UserInfo;
import blog.service.UserService;

import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport{

	private static final Logger log = LoggerFactory.getLogger(UserAction.class);
	
	@Resource
	private UserService userService;
 
	
	/**
	 * 登录
	 * */
	public String login(){
		log.debug("user  login  start...");
		UserInfo user = new UserInfo();
		user.setAddress("ww");
		user.setAnswer("dd");
		user.setBirthday(new Date());
		user.setEmail("ss");
		user.setPassword("sdf");
		user.setQq("sd");
		user.setQuestion("sdf");
		user.setSex(1);
		user.setState(0);
		user.setUserId(1232);
		user.setUsername(":"); 
		
		userService.saveUser(user);
		log.debug("user  login  stop...");
		return SUCCESS;
	}
	
	/**
	 * 注销
	 * */
	public String logout(){
		
		return null;
	}
	/**
	 * 注册
	 * */
	public String regist(){
		
		return null;
	}
	/**
	 * 忘记密码
	 * */
	public String forgetPwd(){
		
		return null;
	}
	/**
	 * 修改密码
	 * */
	public String updatePwd(){
		
		return null;
	}
	/**
	 * 找回账号
	 * */
	public String forgetAccount(){
		
		return null;
	}
	/**
	 * 激活用户
	 * */
	public String activate(){
		
		return null;
	}
	/**
	 * 修改用户信息
	 * */
	public String updateInfo(){
		
		return null;
	}
	/**
	 * 上传头像
	 * */
	public String uploadFace(){
		
		return null;
	}
	 
	public UserService getUserService() {
	    return userService;
	}
	public void setUserService(UserService userService) {
	    this.userService = userService;
	}	
}
